<table>
       <tbody>
            <volist name="sList" id="list">
              <tr data-id="{$list['store_id']}">

                <td align="center" axis="col0">
                  <div style="width: 50px;">{$list.store_id}</div>
                </td>                
				
				<td align="center" axis="col0">
                  <div style="text-align: center; width: 300px;">{$list.name}</div>
                </td> 
				
				<td align="center" axis="col0">
                  <div style="text-align: center; width: 150px;">{$list.phone}</div>
                </td> 
				
				<td align="center" class="">
                  <div style="text-align: center; width: 100px;"><img src="__PUBLICROOT__{$list.icon}" width="80px" height="45px"></div>
                </td>   
                
                <td align="center"  class="">
                	<div style="text-align: center; width: 150px;">{$list['times']|date='Y-m-d H:i',###}</div>
                </td>
                
                <td align="center"  class="">
                	<div style="text-align: center; width: 150px;">{$list['useendtime']}</div>
                </td>
                
                <td align="center" axis="col0">
                  <div style="text-align: center; width: 50px;">
                    <if condition='$list.isshow eq 1'>
                      <span class="yes" onClick="changeTableVal('store','store_id','{$list.store_id}','isshow',this)" ><i class="fa fa-check-circle"></i>是</span>
                      <else />
                      <span class="no" onClick="changeTableVal('store','store_id','{$list.store_id}','isshow',this)" ><i class="fa fa-ban"></i>否</span>
                    </if>
                  </div>
                </td>
                
                <td align="center" class="handle">
                  <div style="text-align: center; width: 250px;">                    
                    <a class="btn red" onClick="toStore('{$list.store_id}')" data-url="{:U('Ad/addel')}" data-id="{$list.store_id}"><i class="fa fa-pencil-square-o"></i>进入店铺</a>
                    <a class="btn red" onClick="toEditStore('{$list.store_id}')"><i class="fa fa-pencil-square-o"></i>编辑</a>
                  
                  </div>
                </td>               

                <td align="" class="" style="width: 100%;">
                  <div>&nbsp;</div>
                </td>
              </tr>
            </volist>             
          </tbody>
        </table>
        <!--分页位置--> {$page}
		<script>
            // 点击分页触发的事件
            $(".pagination  a").click(function(){
                cur_page = $(this).data('p');
                ajax_get_table('search-form2',cur_page);
            });	
			
			
			function toStore(store_id){
		        
		        var url = localUrl+'/index.php?m=Admin&c=Admin&a=tostore';
		        
		        $.ajax({
		            type: "POST",
		            url: "{:U('Admin/tostore')}",
		            data: {storeid:store_id},
		            async:false,
		            dataType: "json",
		            error: function () {
		                layer.alert("服务器繁忙, 请联系管理员!");
		            },
		            success: function (data) {
		                if (data.status == 1) {
//		                    layer.msg(data.msg, {
//		                        icon: 1,
//		                        time: 2000
//		                    });
							var loginKey = data.data;
							console.log('loginKey='+loginKey);
							var url = localUrl+'/index.php?m=Admin&c=Admin&a=toStoreLogin&loginKey='+loginKey+'&types=1';
//							closeWinAndOpen(url);
							window.parent.location.href = url;							
		                } else {
		                    layer.msg(data.msg, {icon: 2,time: 3000});
		                }
		            }
		        });
		    }
			
			
			//编辑
	        function toEditStore(storeid){
	        	var url = localUrl+'/index.php?m=Admin&c=Admin&a=editstore&storeid='+storeid;//"{:U('Admin/editstore',array('storeid'=>"+storeid+"))}";
		        layer.open({
		            type: 2,
		            title: '编辑店铺有效期',
		            shadeClose: true,
		            shade: 0.3,
		            area: ['70%', '80%'],
		            content: url,
		        });
	        }
		        
		        
		        function closeWinAndOpen(url) {
				  var sWinName = "LR"+parseInt(Math.random() * 100000000);//利用随机数处理WinName
				  window.open(url,sWinName, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes');
				  closeCurrentPage();
				}
		        
		        function closeWin() {
				  window.opener=null;
				  window.open('','_self');
				  window.close();
				}
		        
		        function closeCurrentPage() {
				    var userAgent = navigator.userAgent;
				    if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) {
				        window.location.href="about:blank";
				        window.close();
				    } else {
				        window.opener = null;
				        window.open("", "_self");
				        window.close();
				    }
				}
		    
        </script>